package binary;
//补码
public class ComplementDemo {
    public static void main(String[] args) {
        int a=-8;
        System.out.println(Integer.toBinaryString(a));
        String s="1000";
        int b=10;
        int c=b%2;
        int c1=b/2%2;
        int c2=b/2/2%2;
        int c3=b/2/2/2%2;
        System.out.println(c3+""+c2+c1+c);
    }
}
